package cn.net.yto.school.service.impl;

import cn.net.yto.school.dao.entities.TbCourseStudent;
import cn.net.yto.school.dao.repositories.TbCourseStudentRepository;
import cn.net.yto.school.service.CourseStudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
public class CourseStudentServiceImpl implements CourseStudentService {

    @Autowired
    private TbCourseStudentRepository courseStudentRepository;

    @Override
    public List<TbCourseStudent> findAll() {
        return this.courseStudentRepository.findAll();
    }

    @Override
    @Transactional
    public void add(TbCourseStudent courseStudent) {
        this.courseStudentRepository.save(courseStudent);
    }
}
